import java.io.*;
import java.util.*;

class ListNode {
    int val;
    ListNode next = null;
    public ListNode(int val) {
      this.val = val;
  }
}

class Read{
    StringTokenizer st = new StringTokenizer("");
    BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
    public String next () throws IOException {
        while (!st.hasMoreTokens()) {
            st = new StringTokenizer(bf.readLine());
        }
        return st.nextToken();
    }
    public String nextLine() throws IOException {
        return bf.readLine();
    }
    public int nextInt() throws IOException {
        return Integer.parseInt(next());
    }
}

public class Main {
    static Read in = new Read();
    static PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
    static int n = 0;
    static int m = 0;
    static int [][]board=new int[101][101];
    static int[]dx={0,0,1,-1};
    static int[]dy={1,-1,0,0};
    public static void main1(String[] args) throws IOException {
        n = in.nextInt();m= in.nextInt();
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                board[i][j]= in.nextInt();
            }
        }
        int ret=0;
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                ret=Math.max(ret,dfs(i,j));
            }
        }
        out.println(ret);
        out.close();
    }

    private static int dfs(int i, int j) {
        int len = 1;
        for (int k = 0; k < 4; k++) {
            int x = i+dx[k];
            int y = j+dy[k];
            if(x>=0&&x<n&&y>=0&&y<m&&board[x][y]<board[i][j]) {
                len = Math.max(len,dfs(x,y)+1);
            }
        }
        return len;
    }

    public static void main2(String[] args) throws IOException {
        Scanner in = new Scanner(System.in);
        StringBuilder sb = new StringBuilder();
        while (in.hasNext()) {
            String s = in.nextLine();
            s = s.replace(" ","");
            sb.append(s);
        }
        String str = sb.toString();
        int[] hash = new int[26];
        str = str.replace(" ","");
        int max = Integer.MIN_VALUE;
        char s = 0;
        for (int i = 0; i < str.length(); i++) {
            hash[str.charAt(i)-'a']++;
            if(hash[str.charAt(i)-'a'] > max) {
                s = str.charAt(i);
                max = hash[str.charAt(i)-'a'];
            }
        }
        System.out.println(s);
    }

    public static void main3(String[] args) throws IOException {
        String str = in.next();
        str = str.replace("-","");
        char[] ch = str.toCharArray();
        int[] hash = new int[300];
        for (char s : ch) {
            hash[s]++;
        }
        Queue<Integer> heap = new PriorityQueue<>();
        for (int i = 0; i < 300; i++) {
            if(hash[i]>0) {
                heap.offer(hash[i]);
            }
        }
        int ret=0;
        while (heap.size() > 1) {
            int t1 = heap.poll();int t2 = heap.poll();
            ret +=t1 + t2;
            heap.offer(t1+t2);
        }
        System.out.println(ret);
    }

    public static void main4(String args[]){
        Scanner scan=new Scanner(System.in);
        String str=scan.next();
        int min=Integer.MAX_VALUE;
        for(int i='a';i<='z';i++){
            int count=0;
            for(int j=0;j<str.length();j++){
                int t=Math.abs(str.charAt(j)-i);
                count+=Math.min(t,26-t);
            }
            min=Math.min(min,count);
        }
        System.out.println(min);
    }

    public boolean solve (String A, String B) {
        if(A.equals(B)) {
            return true;
        } else if (A.length()!=B.length()) {
            return false;
        }
        for (int i = 0; i < A.length()-1; i++) {
            StringBuilder sb = new StringBuilder();
            sb.append(A.substring(i,A.length()));
            sb.append(A.substring(0,i));
            if(sb.toString().equals(B)) {
                return true;
            }
        }
        return false;
    }
    public ListNode mergeKLists (ArrayList<ListNode> lists) {
//        ListNode node1 = lists.get(0), node2 = lists.get(1);
//        ListNode newHead = new ListNode(0);
//        ListNode cur = newHead;
//        while (node1!=null&&node2!=null) {
//            if(node1.val<=node2.val) {
//                cur.next=node1;
//                node1=node1.next;
//                cur=cur.next
//            }else {
//                cur.next=node2;
//                node2=node2.next;
//                cur=cur.next;
//            }
//        }
//        if(node1!=null) cur.next=node1;
//        if(node2!=null) cur.next=node2;
//        return newHead.next;
        Queue<Integer> queue = new PriorityQueue<>();
        for (int i = 0; i < lists.size(); i++) {
            ListNode cur = lists.get(i);
            while (cur!=null) {
                queue.offer(cur.val);
                cur=cur.next;
            }
        }
        ListNode newHead = new ListNode(0);
        ListNode tail = newHead;
        while (!queue.isEmpty()) {
            ListNode node = new ListNode(queue.poll());
            tail.next = node;
            tail = tail.next;
        }
        return newHead.next;
    }
        static char[] base32 = {
                '9', '8', '7', '6', '5', '4', '3', '2', '1', '0',
                'm', 'n', 'b', 'v', 'c', 'x', 'z', 'a', 's', 'd',
                'f', 'g', 'h', 'j', 'k', 'l', 'p', 'o', 'i', 'u',
                'y', 't'
        };

        public static String decimalToBinary8Bits(int num) {
            StringBuilder binary = new StringBuilder();
            for (int i = 7; i >= 0; i--) {
                binary.append((num & (1 << i)) != 0 ? '1' : '0');
            }
            return binary.toString();
        }

        public static List<Integer> binaryToDecimal(String binaryStr) {
            List<Integer> decimalNums = new ArrayList<>();
            for (int i = 0; i < binaryStr.length(); i += 5) {
                String group = binaryStr.substring(i, Math.min(i + 5, binaryStr.length()));
                int decimal = 0;
                for (char c : group.toCharArray()) {
                    decimal = decimal * 2 + (c - '0');
                }
                decimalNums.add(decimal);
            }
            return decimalNums;
        }

        public static String decimalArrayToBinary(List<Integer> arr) {
            StringBuilder result = new StringBuilder();
            for (int num : arr) {
                StringBuilder binary = new StringBuilder();
                for (int i = 4; i >= 0; i--) {
                    binary.append((num & (1 << i)) != 0 ? '1' : '0');
                }
                result.append(binary);
            }
            return result.toString();
        }

        public static String binaryToChar(String binaryStr) {
            StringBuilder result = new StringBuilder();
            for (int i = 0; i < binaryStr.length(); i += 8) {
                String group = binaryStr.substring(i, Math.min(i + 8, binaryStr.length()));
                int decimal = 0;
                for (char c : group.toCharArray()) {
                    decimal = decimal * 2 + (c - '0');
                }
                result.append((char) decimal);
            }
            return result.toString();
        }

        public static String jiema(String encodedStr) {
            int i;
            for (i = encodedStr.length() - 1; i > 0 && encodedStr.charAt(i) == '+'; i--);
            String newstr = encodedStr.substring(0, i + 1);
            List<Integer> st2 = new ArrayList<>();
            for (char c : newstr.toCharArray()) {
                for (int j = 0; j < base32.length; j++) {
                    if (c == base32[j]) {
                        st2.add(j);
                    }
                }
            }
            String newnewstr = decimalArrayToBinary(st2);
            String res2 = "";

            if (newnewstr.length() % 40 == 10) {
                String newstrs = newnewstr.substring(0, newnewstr.length() - 2);
                res2 = binaryToChar(newstrs);
            } else if (newnewstr.length() % 40 == 20) {
                String newstrs = newnewstr.substring(0, newnewstr.length() - 4);
                res2 = binaryToChar(newstrs);
            } else if (newnewstr.length() % 40 == 25) {
                String newstrs = newnewstr.substring(0, newnewstr.length() - 1);
                res2 = binaryToChar(newstrs);
            } else if (newnewstr.length() % 40 == 35) {
                String newstrs = newnewstr.substring(0, newnewstr.length() - 3);
                res2 = binaryToChar(newstrs);
            }

            return res2;
        }

        public static String solution(String rawStr, String encodedStr) {
            List<Integer> st = new ArrayList<>();
            StringBuilder str1 = new StringBuilder();

            for (char c : rawStr.toCharArray()) {
                str1.append(decimalToBinary8Bits(c));
            }

            int r = str1.length() % 40;
            if (r == 8) {
                str1.append("00");
            } else if (r == 16) {
                str1.append("0000");
            } else if (r == 24) {
                str1.append("0");
            } else if (r == 32) {
                str1.append("000");
            }

            st = binaryToDecimal(str1.toString());
            StringBuilder res1 = new StringBuilder();

            for (int value : st) {
                res1.append(base32[value]);
            }

            while (res1.length() % 8 != 0) {
                res1.append("+");
            }

            StringBuilder res2 = new StringBuilder();
            for (int i = 0; i < encodedStr.length(); i += 8) {
                res2.append(jiema(encodedStr.substring(i, Math.min(i + 8, encodedStr.length()))));
            }

            return res1.toString() + ":" + res2.toString();
        }

        public static void main(String[] args) {
            // You can add more test cases here
            System.out.print(solution("foo", "b0zj5+++"));
            System.out.println(solution("foo", "b0zj5+++").equals("bljhy+++:bar")); // Should print true
            System.out.println(solution("The encoding process represents 40-bit groups of input bits as output strings of 8 encoded characters.  Proceeding from left to right, a 40-bit input group is formed by concatenating 5 8bit input groups. These 40 bits are then treated as 8 concatenated 5-bit groups, each of which is translated into a single character in the base 32 alphabet.  When a bit stream is encoded via the base 32 encoding, the bit stream must be presumed to be ordered with the most-significant-bit first. That is, the first bit in the stream will be the high-order bit in the first 8bit byte, the eighth bit will be the low-order bit in the first 8bit byte, and so on.", "bljhy+++b0zj5+++").equals("maf3m164vlahyl60vlds9i6svuahmiod58l3mi6sbglhmodfcbz61b8vb0fj1162c0jjmi6d58jhb160vlk2mu89b0fj1il9b4ls9oogcak2mu89cvp25pncbuls9oo359i79lncbvjh1ln558ahzknsb4aj1lnscbj7917zc0jh3ln4bafhill9bll3yo09vashbu89cajs9id0buf21n89b5z61b8vb0fj1160vlk2mu89bul3yunz58fj3163vul3pln558a2s166vuj33knfbgj37u60vlds9v0928a3su89v4j29unf58dj5oogc8lsi17fv8sj3l093zk79kd0cals9knsbfz21p64vkz21id4b4p3ml89b4ls9c89bvjhiko8cashiknfbgs79v0vb0fj1162c0jjmi6d4zz3mkn6v9z3yla9cuf3sko158fj316fc0zhiiobb4p3ml89v4j21ol9b5z23pncbuh3m166v8zj5kn6casj5160vkz21p6458a37io459ld5168vak3zkn7bgp7i189muf3moa9b5z35pnf58lj1id4b4hs9pnd58shikoxbash116hv4zs9u61bfz35kndbfz63ba9bgj33oo5v4j3cn89caf3m167v4p79iofc0sh7o09vgpj3u89b0ss9i6sbgljmon4bzz21ol9b0ss9oosbasj5ln558ohsu6158p3zl09vgjj3u8vcvfhcod0blfh3kncczhs9kd0czz3bpnscvp7i17fv8zj1160cbh79u61bfz3bpnscvp79kd0czz3soa9caf3m16dcal3mknv58ohso6b58a3m16fv8ss9p60buf7p16xc0s3mia9b0fj1160vkz21p6458d3siddczz6zkd0czz35ynfbfh79u61bfz3mpn2v8p3z167v4p79uo0vah79kd458p3zl09vajjcn09vul31lns58a3su89v4j79u61bfz3bpnscvp79c67v4p79kdlcassk168vls79iox58jhinz+:foobar")); // Should print true
        }
}